import {Component, OnInit} from '@angular/core';
import {AuthService} from '../../basic/auth/auth.service';
import {globalCache} from '../../basic/commons/cache.manage';

@Component({
    selector: 'app-head',
    templateUrl: './head.component.html',
    styleUrls: ['./head.component.scss']
})
export class HeadComponent implements OnInit {

    private _loginName: string;
    constructor(private authService: AuthService) {
    }

    get loginName(): string {
        return this._loginName;
    }

    ngOnInit() {
        this._loginName = globalCache.getUser().loginName;
    }

    logout() {
        this.authService.doLogout();
    }
}
